package com.ict.txmsv2.services;

import com.ict.txmsv2.mapper.UserRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author linzzz
 * @desc ...
 * @date 2020-12-17
 */
@Service
public class UserRoleService {
    @Autowired
    UserRoleMapper userRoleMapper;

    public boolean updateRolesByUserid(Integer userId, Integer[] rids) {
        userRoleMapper.deleteUserRoleByUserid(userId);
        int result = userRoleMapper.updateRolesByUseridAndrids(userId,rids);
        return result == rids.length;
    }
}
